﻿using DAMS.Models;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace DAMS.Web.Areas.Manage.Models
{
    public class CategoryCreateViewModel
    {
        public string TreeJson { get; set; }
        public string TemplatesJson { get; set; }

        [Display(Name ="分类名称")]
        [Required(ErrorMessage ="请输入分类名称")]
        [StringLength(10,MinimumLength =1,ErrorMessage ="分类长度最小1个字符，最大10个字符")]
        public string Name { get; set; }
        [Display(Name = "上级分类")]
        [Required(ErrorMessage = "请选择上级分类")]
        [Range(1,1000000,ErrorMessage ="请选择上级分类")]
        public int ParentID { get; set; }
        [Required(ErrorMessage = "请选择分类类型")]
        [Display(Name = "分类类型")]
        public CategoryType Type { get; set; }
        /// <summary>
        /// 显示位置
        /// </summary>
        [Display(Name = "显示位置")]
        public string ShowType { get; set; }
        [Required(ErrorMessage = "请选择模版或输入Url")]
        [Display(Name = "模板或Url")]
        public string Template { get; set; }
        [Display(Name = "内容页模板")]
        public string ArticleTemplate { get; set; }
        [Display(Name ="内容")]
        public string Content { get; set; }
        /// <summary>
        /// HTML页面的描述
        /// </summary>
        [Display(Name = "HTML页面描述")]
        public string HtmlDescription { get; set; }
        /// <summary>
        /// Html页面关键字
        /// </summary>
        [Display(Name = "HTML页面关键字")]
        public string HtmlKeyWord { get; set; }
    }
}
